package com.yang.action;

import com.yang.service.ProductService;
import com.yang.service.ProductcarService;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/AddProductCar")
public class ProductCarAction extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String pid = req.getParameter("id");
        System.out.println(pid);
        String count = req.getParameter("count");
        System.out.println(count);
        String uuid = req.getParameter("uuid");
        System.out.println(pid);
        ProductcarService productcarService = new ProductcarService();
        RespEntity respEntity = productcarService.addProductcar(Integer.parseInt(pid), Integer.parseInt(uuid), Integer.parseInt(count));
        RespUtil.sendJSON(resp, respEntity);
    }
}
